import ajax from "@/utils/request";


// 获取购物车数据
export function getCart(data: {userid: string}){
  return ajax({
    url: '/cart/list',
    method: 'post',
    data
  })
}

// 更新选中状态的接口
export function selectoneCart(data: {cartid: string, flag: boolean}){
  return ajax({
    url: '/cart/selectone',
    method: 'post',
    data
  })
}

// 更新购物数量的接口
export function updateNum(data: {cartid: string, num: string}){
  return ajax({
    url: '/cart/updatenum',
    method: 'post',
    data
  })
}

// 添加购物车的接口
export function addCart(data: {userid: string, proid: string, num: number}){
  return ajax({
    url: '/cart/add',
    method: 'post',
    data
  })
}
